﻿namespace WMS6.Web.Analytics
{
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;
    using WMS6.Web.UserControls;

    public class ShipmentOrderStatusRptQuery : BasePage
    {
        protected Button btnSearch;
        protected DropDownList ddlConsigneeID;
        protected DropDownList ddlExternOrderID;
        protected DropDownList ddlOrderIDOper;
        protected DropDownList ddlOwnerID;
        protected DropDownList ddlStatusOper;
        protected DropDownList ddlTypeOper;
        protected DropDownList DropDownList1;
        protected HtmlForm F15420;
        protected HtmlInputHidden hdnActionID;
        protected HtmlInputHidden hdncalendarFlag;
        protected HtmlInputHidden hdnDataFormat;
        protected Label Label1;
        protected Label lblConsigneeID;
        protected Label lblEndTime;
        protected Label lblExternOrderID;
        protected Label lblOrderID;
        protected Label lblOwnerID;
        protected Label lblShipmentOrderRpt;
        protected Label lblStartTime;
        protected Label lblStatus;
        protected Label lblType;
        protected MultipleSelectControl MSCStatus;
        protected MultipleSelectControl MSCType;
        protected HtmlLink mycss;
        protected TextBox TextBox1;
        protected TextBox txtConsigneeID;
        protected TextBox txtEndTime;
        protected TextBox txtExternOrderID;
        protected TextBox txtOrderID;
        protected TextBox txtOwnerID;
        protected TextBox txtStartTime;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("ShipmentOrderStatusRptList.aspx", false);
        }

        private void InitDropDownLists()
        {
            base.InitQueryDDL(this.ddlOwnerID, 0);
            base.InitQueryDDL(this.ddlExternOrderID, 0);
            base.InitQueryDDL(this.DropDownList1, 0);
            base.InitQueryDDL(this.ddlOwnerID, 0);
            base.InitQueryDDL(this.ddlConsigneeID, 0);
            base.InitQueryDDL(this.ddlTypeOper, 0);
            base.InitQueryDDL(this.ddlStatusOper, 0);
            base.InitQueryDDL(this.ddlOrderIDOper, 0);
            base.BindData2DDLBySysCode(this.MSCType, "OrderType");
            this.ddlTypeOper.SelectedValue = "One Of";
            base.BindData2DDLBySysCode(this.MSCStatus, "OrderStatus");
            this.ddlStatusOper.SelectedValue = "One Of";
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.InitDropDownLists();
            }
        }

        public string ConsigneeID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtConsigneeID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtConsigneeID.Text.Trim(), this.ddlConsigneeID.SelectedValue);
                }
                return "";
            }
        }

        public string EndTime
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtEndTime.Text.Trim()))
                {
                    return (Convert.ToDateTime(this.txtEndTime.Text).ToString("yyyy-MM-dd") + " 23:59:59");
                }
                return "";
            }
        }

        public string ExternOrderID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtExternOrderID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtExternOrderID.Text.Trim(), this.ddlExternOrderID.SelectedValue);
                }
                return "";
            }
        }

        public string OrderID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOrderID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOrderID.Text.Trim(), this.ddlOrderIDOper.SelectedValue);
                }
                return "";
            }
        }

        public string OwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerID.Text.Trim(), this.ddlOwnerID.SelectedValue);
                }
                return "";
            }
        }

        public string SkuClassID
        {
            get
            {
                return "";
            }
        }

        public string SkuID
        {
            get
            {
                return "";
            }
        }

        public string StartTime
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtStartTime.Text.Trim()))
                {
                    return (Convert.ToDateTime(this.txtStartTime.Text).ToString("yyyy-MM-dd") + " 00:00:00");
                }
                return "";
            }
        }

        public string Status
        {
            get
            {
                if (!string.IsNullOrEmpty(this.MSCStatus.ReturnValue))
                {
                    return base.GetParamsString(this.MSCStatus.ReturnValue, this.ddlStatusOper.SelectedValue);
                }
                return "";
            }
        }

        public string Type
        {
            get
            {
                if (!string.IsNullOrEmpty(this.MSCType.ReturnValue))
                {
                    return base.GetParamsString(this.MSCType.ReturnValue, this.ddlTypeOper.SelectedValue);
                }
                return "";
            }
        }
    }
}

